import Vue from "vue";
export default {
  namespaced: true,
  state: {
    workFilterList: {},
    worksingleLocationList: {},
    loadDataWork: false,
    loadDataWorkGoTo: false,
    workbenchListStore: {},
    workListScrollTop: 0,
  },
  mutations: {
    // 全部大区
    set_FilterList: (state, data) => {
      Vue.set(state.workFilterList, data.key, data.value);
    },
    del_FilterList: (state, data) => {
      for (
        let index = 0;
        index <= state.workFilterList[data.index].length;
        index++
      ) {
        if (state.workFilterList[data.index][index].key == data.key) {
          Vue.delete(state.workFilterList[data.index], index);
        }
      }
    },
    // 单个站点
    set_LocationList: (state, data) => {
      Vue.set(state.worksingleLocationList, data.key, data.value);
    },
    del_LocationList: (state, data) => {
      for (
        let index = 0;
        index <= state.worksingleLocationList[data.index].length;
        index++
      ) {
        if (state.worksingleLocationList[data.index][index].key == data.key) {
          Vue.delete(state.worksingleLocationList[data.index], index);
        }
      }
    },
    set_loadDataWork: (state, data) => {
      state.loadDataWork = data.value;
    },
    set_loadDataWorkGoTo: (state, data) => {
      state.loadDataWorkGoTo = data.value;
    },
    set_workbenchListStore: (state, data) => {
      state.workbenchListStore = data.value;
    },
    set_workListScrollTop: (state, data) => {
      state.workListScrollTop = data.value;
    },
  },
  actions: {},
};
